Convert to composite run steps action #14
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the action was created, the only option for non-JavaScript actions was to use a Docker container. However, GitHub
recently added a new action type: the "composite run steps action".
The Docker container approach has the significant advantage of providing a controlled environment for the action to run in, which will not pollute the general environment of the runner for later workflow steps. However it also has a couple disadvantages:
/github/workspace
.The problem with the first is it prevents testing for other operating systems. Arduino boards platforms have different toolchains and even build properties according to operating system of the machine they are running on. Only testing on a Linux system may result in missing issues that affect the majority of users.
Although more still needs to be done to make the action cross-platform (example1, example2), converting to a composite run steps action is the first step toward that goal.
The problem with the second is that, in order to be valid, an Arduino sketch folder must match the filename of the primary sketch file. For a sketch in the root of the repository, a sketch author might achieve this to some limited extent by naming the repository to match the primary sketch file name. However, the container volume is not named according to the repository name, so sketches in the root of the repository are not currently supported by the action (except in the unlikely event the sketch happens to be named "workspace"). Even though structuring sketch repositories in this manner is not best practices due to GitHub's popular "Download ZIP" appending the Git ref to the end of the folder name, the purpose of this action is to compile sketches, not legislate repository policy, so it is reasonable to support this use case.
The workspace folder in the GitHub Actions runner is named according to the repository name, meaning that converting to a composite run steps action permits use with sketches in the root of the repository.
I ran a few workflows with the version of the action from this PR: